/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vale.sax.sintaxis;

import vale.util.StrCmp;
import vale.util.StrOp;

/**
 *
 * @author juan
 */
abstract class EndElement {

    static boolean validate(String xmlElment) {
        boolean valid = true;
        if (!xmlElment.startsWith("</") || !xmlElment.endsWith(">")) {
            valid = false;
        } else if (!validarNombe(xmlElment)) {
            valid = false;
        }
        return valid;
    }

    private static boolean validarNombe(String xmlElment) {
        String name=StrOp.getNameOfTag(xmlElment, "</", ">");
        return StrCmp.hasOnlyAlphaNumAndDashes(name);
    }
}
